import requests
import time
import json

# SSE服务器消息接收地址
url = "http://localhost/publish" 


while True:
	message = {'message': 'msg' + str(time.time())}
	headers = {'Content-Type': 'application/json' }

	response = requests.post(url, data=json.dumps(message), headers=headers)

	if response.status_code == 200 or response.status_code == 204:
		print("Send Successfully")		
	else:
		print("Send Failed:", response.status_code)
	time.sleep(3)
	